﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CupsTool
{
    public partial class App2
    {
        public async void Start()
        {
            var devs = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
            DeviceInformation bc = devs.FirstOrDefault(d => d.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Back);
            if (bc != null)
            {
                MediaCaptureInitializationSettings settings = new MediaCaptureInitializationSettings();
                settings.AudioDeviceId = "";
                settings.VideoDeviceId = bc.Id;
                capture = new MediaCapture();
                await capture.InitializeAsync(settings);
            }
        }
    }
}
